package com.qk.management.controller;

import com.qk.common.Result;
import com.qk.entity.Weather;
import com.qk.management.weather.WeatherUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 16778
 * @date 2025/10/8 20:30
 * @description
 */
@RestController
@RequestMapping("/weather")
public class WeatherController {
    @GetMapping
    public Result get(String city){
        Weather weather = WeatherUtil.getWeather(city);
        System.out.println("后端获得的weather:"+weather);
        return Result.success(weather);
    }
}
